#pragma once

#include <iostream>
#include <string>
#include <ctime>

#define Info    1
#define Warning 2
#define Debug   3
#define Fatal   4

#define LOG(LEVEL, MESSAGE) log(#LEVEL, MESSAGE, __FILE__, __LINE__)

void log(std::string level, std::string message, std::string file, int line)
{
    time_t t = time(nullptr);
    struct tm *ctime = localtime(&t);
    // std::cout << "[" << file << " : " << line << "]" << "[" << level << "]" << "[" << time(nullptr) << "]" << "[" << message << "]" << std::endl;
    printf("[%s : %d] [%s][%d-%d-%d %d:%d:%d] [%s]\n", file.c_str(), line, level.c_str(), ctime->tm_year+1900, ctime->tm_mon+1, ctime->tm_mday,
                ctime->tm_hour, ctime->tm_min, ctime->tm_sec, message.c_str());
}

        